package com.ruoyi.web.controller.example;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.example.service.StudentService;
import com.ruoyi.web.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Anonymous
@RestController
public class StudentController {
    @Autowired
    private StudentService service;
    @GetMapping("/list")
    private String list(){
        return service.getStudents();
    }
    @PostMapping("/user")
    public String json(@RequestBody User user){
        return "用户的姓名是:"+user.getName()+
                "用户的学号是:"+user.getSno()+
                "用户的性别是:"+user.getGender();

    }
}
